<?php

namespace front\models;

use Yii;

/**
 * This is the model class for table "order_users".
 *
 * @property integer $id
 * @property integer $user_id
 * @property integer $status
 * @property string $name
 * @property integer $district
 * @property string $address
 * @property string $tel
 * @property string $mobile
 * @property integer $created_at
 * @property integer $updated_at
 */
class OrderusersModel extends \common\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'order_users';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db');
    }
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'name', 'district', 'address'], 'required'],
            [['user_id', 'status', 'district', 'created_at', 'updated_at'], 'integer'],
            [['name', 'tel', 'mobile'], 'string', 'max' => 45],
            [['address'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'status' => 'Status',
            'name' => 'Name',
            'district' => 'District',
            'address' => 'Address',
            'tel' => 'Tel',
            'mobile' => 'Mobile',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
